<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="../themes/general.css">
	<link rel="stylesheet" type="text/css" href="../themes/icon.css">
	<link rel="stylesheet" type="text/css" href="../themes/gray/easyui.css">
	<script type="text/javascript" src="../scripts/jquery-1.8.0.min.js"></script>
	<script type="text/javascript" src="../scripts/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="../scripts/locale/easyui-lang-zh_CN.js"></script>
	<title>Login</title>
	<script type="text/javascript">
		$(function(){
			$('#login_form').form({
				url:'../ana/login.ajax',
				onSubmit:function(){
					// do some check  
					// return false to prevent submit;
					//return $(this).form('validate');
					return true;
				},
				success:function(data){
					//需要返回的json数据样例
					//成功: {"success":true,"message":null}
					//失败: {"success":false,"message":"商户名称重复"}
					var obj = $.parseJSON(data);  
                    if(obj.success){  
                    	 //$.messager.alert('Info','提交成功','info');  
                        //$("#main_form").form('clear');
                        window.location.href = "main.htm";  
                    }
                    else{  
                        $.messager.alert('Error','登录失败:'+obj.message, 'error');  
                        changeCaptchaCode();
                    }  
				}
			});
			
			//jump out the iframe container
			if (window != top)
			 	top.location.href = location.href; 
			
			$('#btn_login').bind('click', function(){  
				//alert("login click");
				do_login();  
        	});
        	
        	$('#username').bind('keydown', function(e){  
				var curKey = e.which;
				if(curKey==13) {
					$('#password').focus();
				}  
        	});
        	
        	$('#password').bind('keydown', function(e){  
				var curKey = e.which;
				if(curKey==13) {
					do_login();
				}  
        	});
        	$('#username').focus();
        	
        });
        
        function do_login() {
        	if($.trim($("#username").val())=="") { 	
	        	alert("请输入用户名");
	        	return;
        	}
        	
        	if($.trim($("#password").val())=="") { 	
	        	alert("请输入密码");
	        	return;
        	}
        	$("#login_form").submit();
        }
		
	</script>

<style type="text/css">
img.pos_img1
{
position:absolute;
top: 30px;
left: 10px;
}
img.pos_img2
{
position:absolute;
top: 150px;
left: 50px;
}


</style>
</head>
<body>

<div ><img src="../images/oil.jpg" class="" width=100% height=100%/></div>

<div style="margin:200 auto;width:360px;height:170px;background:#F9F9F9;border:1px solid #EBEBEB;position:absolute;
top: 70px;left: 850px;" >
		<div style="height:22px;padding:10px 10px 0px 10px;font:bold;font-size:18px">
			<b>欢迎访问监理信息管理系统</b></div>
		<form id="login_form" method="post">
			<table width="100%" align="center" style="font-size:12px;">
            	<tr height="28px">
                	<td width="28%" rowspan="3" align="center" valign="top"><img height=80 src="../images/logo1.png"/></td>
                    <td width="17%" align="right">用户名&nbsp;</td>
                    <td width="55%"><input type="text" class="input_120" id="username" value="" name="username">
					</td>
                </tr>
                <tr height="28px">
                		  
                	<td align="right">密码&nbsp;</td>
                    <td><input type="password" class="input_120" id="password" name="password">
					</td>
                </tr>
            </table>

			<div class="action_bar" style="text-align:center">
				<a id="btn_login" href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok">登录</a>
			</div>
		</form>
	</div>
</body>
</html>